package com.GZHU.controller;

import com.GZHU.fisco.BlockChainClient;
import com.GZHU.fisco.Data_upload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class welcome_controller {
    @Autowired
    JdbcTemplate jdbcTemplate;
    //获取所有的模型 ID
    public List<Object> get_all_model(){
        String sql="select model_id from model_info";
        List res=jdbcTemplate.queryForList(sql);
        return res;
    }
    @GetMapping("/")
    public String welcome_controller(HttpServletRequest request){
        List all_model=get_all_model();
        request.setAttribute("all_model",all_model);
        return "welcome";
    }
}
